import {Form, Input} from "antd";
import BaseEntity from "@/type/BaseEntity";
import InputProps from "@/common/form/porps";
import type {Rule} from "rc-field-form/lib/interface";
interface IProps<T extends BaseEntity> extends InputProps<T>{
    a? : string
}
const InputText = <T extends BaseEntity>(props: IProps<T>) => {
    const rules: Rule[] = [
        {
            required: props.required,
            message: `请输入${props.label}!`
        },
    ];
    return (
        <Form.Item<T> name={props.name as any} label={props.label} hidden={props.hidden} required={props.required} rules={rules}>
            <Input disabled={props.disabled}/>
        </Form.Item>
        );
};

export default InputText;